﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using HengTong.Model._Admin;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db;
using HengTong.Model.Db.System;
using TiaoTaoHelper.Wtm.Models;


namespace HengTong.ViewModel._Admin.SysUserJobPositionVms
{
    public partial class SysUserJobPositionTemplateVm : BaseTemplateVM
    {
        [Display(Name = "用户")]
        public ExcelPropety UserExcel = ExcelPropety.CreateProperty<SysUserJobPosition>(x => x.UserId);
        [Display(Name = "岗位")]
        public ExcelPropety JobPositionExcel = ExcelPropety.CreateProperty<SysUserJobPosition>(x => x.JobPositionId);
        [Display(Name = "是否主岗")]
        public ExcelPropety IsMainExcel = ExcelPropety.CreateProperty<SysUserJobPosition>(x => x.IsMain);

	    protected override void InitVM()
        {
            UserExcel.DataType = ColumnDataType.ComboBox;
            UserExcel.ListItems = DC.Set<FrameworkUser>().GetSelectListItems(Wtm, y => y.Name);
            JobPositionExcel.DataType = ColumnDataType.ComboBox;
            JobPositionExcel.ListItems = DC.Set<SysJobPosition>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysUserJobPositionImportVm : BaseImportVM<SysUserJobPositionTemplateVm, SysUserJobPosition>
    {

    }

}
